<table class="table table-bordered table-hover table-striped">
	<tbody>
		<tr align="center">
			<td width="5%"><strong>编号</strong></td>
			<td width="7%"><strong>房间号</strong></td>
			<td width="8%"><strong>姓名</strong></td>
			<td width="5%"><strong>表类型</strong></td>
			<td width="8%"><strong>起数</strong></td>
			<td width="8%"><strong>止数</strong></td>
			<td width="8%"><strong>费用</strong></td>
			<td width="8%"><strong>欠费</strong></td>
			<td width="10%"><strong>抄表日期</strong></td>
			<td width="5%"><strong>处置</strong></td>
			<td width="8%"><strong>处置人</strong></td>
			<td width="20%"><strong>操作</strong></td>
		</tr>
		<?php if(is_array($list) && count($list)){ foreach($list as $k=>$ls){ ?>
			<?php $rowspan = count($ls['list']); foreach($ls['list'] as $kk=>$lls){ ?>
				<tr align="center">
				<?php if($kk==0){ ?>
					<td rowspan="{$rowspan}" style="background-color: #ffffff"><?php echo ($page-1)*C('PAGE_SIZE')+($k+1); ?></td>
					<td rowspan="{$rowspan}" style="background-color: #ffffff">{$ls['roomnumber']}</td>
					<td rowspan="{$rowspan}" style="background-color: #ffffff">{$ls['member_nick']}</td>
				<?php } ?>
					<td>{$lls['eqmtitle']}</td>
					<td>{$lls['real_start_number']/10}</td>
					<td>{$lls['last_number']/10}</td>
					<td><?php echo ($lls['last_number'] - $lls['real_start_number'])/10 * $lls['rates']; ?></td>
					<td>-{$lls['balance']}</td>
					<td><?php echo date('Y-m-d H:i', $lls['updatetime']); ?></td>
					<td id="st_{$lls['eqment_id']}"><?php echo !$lls['state'] ? '停止' : '启用'; ?></td>
					<td>{$lls['user_nick']}</td>
					<!--<td><?php echo $lls['stoptime'] ? date('Y-m-d H:i') : '---'; ?></td>-->
					<td>
						<a href="javascript:void(0);" class="act" vl="1" ids="{$lls['eqment_id']}">启用</a> |
						<a href="javascript:void(0);" class="act" vl="0" ids="{$lls['eqment_id']}">停用</a> |
						<a href="javascript:void(0);" class="acts" vl="2" ids="{$lls['eqment_id']}">短信通知</a>
					</td>
				</td>
			<?php } ?>
		<?php }}else{ ?>
		<tr align="center">
			<td colspan="14">暂无数据...</td>
		</tr>
		<?php } ?>
	</tbody>
</table>
<div class="pagination" style="float: right; widht: 95%">
	<include file="Common/page" />
</div>
<script>
	$(document).ready(function(){
		$(".goback").on('click', function(){
			var id = $(this).attr('logid');
			$.post('__ACTION__', {id: id}, function(data){
				if(data/1 == 1){
					$("#log_"+ id).html('已退卡');
				}else{
					alert(data);
				}
			});
		});

		//修改状态
		$(".act").on('click', function(){
			var obj = $(this);
			var	status = obj.attr('vl');
			var	id = obj.attr('ids');
			$.post('../eqment/setstatus.html', {id: id, status: status}, function(data){
				if(data/1){
					var shtml = status/1 == 1 ? '启用' : '停用';
					$("#st_"+ id).html(shtml);
				}
			});
		});
	});
</script>